import requests
r = requests.get('https://www.douban.com/')
print(r.status_code)
#print(r.text)
r = requests.get('http://www.douban.com/search',params={'q':'python','cat':'1001'})
print(r.url)
print(r.encoding)
print(r.content)
r = requests.get('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%202151330&format=json')
print(r.json())
r = requests.get('https://www.douban.com/', headers={'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit'})
print(r.text)
r = requests.post('https://accounts.douban.com/login', data={'form_email': 'abc@example.com', 'form_password': '123456'})
upload_files = {'file': open('report.xls','rb')}
r = requests.post(url,files = upload_files)